home *** CD-ROM | disk | FTP | other *** search
- #include <stdio.h>
- #include <unistd.h>
- #include <string.h>
- #include <stdlib.h>
-
- void ag_get_html(char *filename)
- {
- FILE *html;
- int a;
- html=fopen(filename,"rt");
- if (html==NULL) exit(1);
- printf("Content-Type: text/html\n\n");
- while(!feof(html)) {
- a=fgetc(html);
- if (!feof(html)) printf("%c",a);
- }
- fclose(html);
- }
-
- void ag_jump_module(char *filename, char *process, char *variable, char *value)
- {
- char args[1024],qs[1024],env[1024];
- strcpy(env,"QUERY_STRING=");
- strcpy(args,"AG_PROCESS=");
- strcat(args,process);
- strcat(args,"&");
- strcat(args,variable);
- strcat(args,"=");
- strcat(args,value);
- strcpy(qs,getenv("QUERY_STRING"));
- strcat(env,args);
- putenv(env);
- execl(filename,args,NULL);
- }
-